\(\int \frac {A+B \log (e (a+b x)^n (c+d x)^{-n})}{a f h+b g h x^2+h (b f x+a g x)} \, dx\) [261]
Optimal result
Integrand size = 49, antiderivative size = 123 \[
\int \frac {A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{a f h+b g h x^2+h (b f x+a g x)} \, dx=-\frac {\left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \log \left (1-\frac {(b f-a g) (c+d x)}{(d f-c g) (a+b x)}\right )}{(b f-a g) h}+\frac {B n \operatorname {PolyLog}\left (2,\frac {(b f-a g) (c+d x)}{(d f-c g) (a+b x)}\right )}{(b f-a g) h}
\]
[Out]
-(A+B*ln(e*(b*x+a)^n/((d*x+c)^n)))*ln(1-(-a*g+b*f)*(d*x+c)/(-c*g+d*f)/(b*x+a))/(-a*g+b*f)/h+B*n*polylog(2,(-a*
g+b*f)*(d*x+c)/(-c*g+d*f)/(b*x+a))/(-a*g+b*f)/h
Rubi [A] (verified)
Time = 0.21 (sec) , antiderivative size = 123, normalized size of antiderivative = 1.00, number of
steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.122, Rules used = {2573, 2576, 3, 1607, 2379,
2438} \[
\int \frac {A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{a f h+b g h x^2+h (b f x+a g x)} \, dx=\frac {B n \operatorname {PolyLog}\left (2,\frac {(b f-a g) (c+d x)}{(d f-c g) (a+b x)}\right )}{h (b f-a g)}-\frac {\log \left (1-\frac {(c+d x) (b f-a g)}{(a+b x) (d f-c g)}\right ) \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )}{h (b f-a g)}
\]
[In]
Int[(A + B*Log[(e*(a + b*x)^n)/(c + d*x)^n])/(a*f*h + b*g*h*x^2 + h*(b*f*x + a*g*x)),x]
[Out]
-(((A + B*Log[(e*(a + b*x)^n)/(c + d*x)^n])*Log[1 - ((b*f - a*g)*(c + d*x))/((d*f - c*g)*(a + b*x))])/((b*f -
a*g)*h)) + (B*n*PolyLog[2, ((b*f - a*g)*(c + d*x))/((d*f - c*g)*(a + b*x))])/((b*f - a*g)*h)
Rule 3
Int[(u_.)*((a_) + (c_.)*(x_)^(j_.) + (b_.)*(x_)^(n_.))^(p_.), x_Symbol] :> Int[u*(b*x^n + c*x^(2*n))^p, x] /;
FreeQ[{a, b, c, n, p}, x] && EqQ[j, 2*n] && EqQ[a, 0]
Rule 1607
Int[(u_.)*((a_.)*(x_)^(p_.) + (b_.)*(x_)^(q_.))^(n_.), x_Symbol] :> Int[u*x^(n*p)*(a + b*x^(q - p))^n, x] /; F
reeQ[{a, b, p, q}, x] && IntegerQ[n] && PosQ[q - p]
Rule 2379
Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)/((x_)*((d_) + (e_.)*(x_)^(r_.))), x_Symbol] :> Simp[(-Log[1 +
d/(e*x^r)])*((a + b*Log[c*x^n])^p/(d*r)), x] + Dist[b*n*(p/(d*r)), Int[Log[1 + d/(e*x^r)]*((a + b*Log[c*x^n])^
(p - 1)/x), x], x] /; FreeQ[{a, b, c, d, e, n, r}, x] && IGtQ[p, 0]
Rule 2438
Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2, (-c)*e*x^n]/n, x] /; FreeQ[{c, d,
e, n}, x] && EqQ[c*d, 1]
Rule 2573
Int[((A_.) + Log[(e_.)*(u_)^(n_.)*(v_)^(mn_)]*(B_.))^(p_.)*(w_.), x_Symbol] :> Subst[Int[w*(A + B*Log[e*(u/v)^
n])^p, x], e*(u/v)^n, e*(u^n/v^n)] /; FreeQ[{e, A, B, n, p}, x] && EqQ[n + mn, 0] && LinearQ[{u, v}, x] && !I
ntegerQ[n]
Rule 2576
Int[((A_.) + Log[(e_.)*(((a_.) + (b_.)*(x_))/((c_.) + (d_.)*(x_)))^(n_.)]*(B_.))^(p_.)*(P2x_)^(m_.), x_Symbol]
:> With[{f = Coeff[P2x, x, 0], g = Coeff[P2x, x, 1], h = Coeff[P2x, x, 2]}, Dist[b*c - a*d, Subst[Int[(b^2*f
- a*b*g + a^2*h - (2*b*d*f - b*c*g - a*d*g + 2*a*c*h)*x + (d^2*f - c*d*g + c^2*h)*x^2)^m*((A + B*Log[e*x^n])^p
/(b - d*x)^(2*(m + 1))), x], x, (a + b*x)/(c + d*x)], x]] /; FreeQ[{a, b, c, d, e, A, B, n}, x] && PolyQ[P2x,
x, 2] && NeQ[b*c - a*d, 0] && IntegerQ[m] && IGtQ[p, 0]
Rubi steps \begin{align*}
\text {integral}& = \text {Subst}\left (\int \frac {A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )}{a f h+b g h x^2+h (b f x+a g x)} \, dx,e \left (\frac {a+b x}{c+d x}\right )^n,e (a+b x)^n (c+d x)^{-n}\right ) \\ & = \text {Subst}\left ((b c-a d) \text {Subst}\left (\int \frac {A+B \log \left (e x^n\right )}{a b^2 f h+a^2 b g h-a b (b f h+a g h)-(2 a b d f h+2 a b c g h-b c (b f h+a g h)-a d (b f h+a g h)) x+\left (a d^2 f h+b c^2 g h-c d (b f h+a g h)\right ) x^2} \, dx,x,\frac {a+b x}{c+d x}\right ),e \left (\frac {a+b x}{c+d x}\right )^n,e (a+b x)^n (c+d x)^{-n}\right ) \\ & = \text {Subst}\left ((b c-a d) \text {Subst}\left (\int \frac {A+B \log \left (e x^n\right )}{(-2 a b d f h-2 a b c g h+b c (b f h+a g h)+a d (b f h+a g h)) x+\left (a d^2 f h+b c^2 g h-c d (b f h+a g h)\right ) x^2} \, dx,x,\frac {a+b x}{c+d x}\right ),e \left (\frac {a+b x}{c+d x}\right )^n,e (a+b x)^n (c+d x)^{-n}\right ) \\ & = \text {Subst}\left ((b c-a d) \text {Subst}\left (\int \frac {A+B \log \left (e x^n\right )}{x \left (-2 a b d f h-2 a b c g h+b c (b f h+a g h)+a d (b f h+a g h)+\left (a d^2 f h+b c^2 g h-c d (b f h+a g h)\right ) x\right )} \, dx,x,\frac {a+b x}{c+d x}\right ),e \left (\frac {a+b x}{c+d x}\right )^n,e (a+b x)^n (c+d x)^{-n}\right ) \\ & = -\frac {\left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \log \left (1-\frac {(b f-a g) (c+d x)}{(d f-c g) (a+b x)}\right )}{(b f-a g) h}+\text {Subst}\left (\frac {(B n) \text {Subst}\left (\int \frac {\log \left (1+\frac {-2 a b d f h-2 a b c g h+b c (b f h+a g h)+a d (b f h+a g h)}{\left (a d^2 f h+b c^2 g h-c d (b f h+a g h)\right ) x}\right )}{x} \, dx,x,\frac {a+b x}{c+d x}\right )}{(b f-a g) h},e \left (\frac {a+b x}{c+d x}\right )^n,e (a+b x)^n (c+d x)^{-n}\right ) \\ & = -\frac {\left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \log \left (1-\frac {(b f-a g) (c+d x)}{(d f-c g) (a+b x)}\right )}{(b f-a g) h}+\frac {B n \text {Li}_2\left (\frac {(b f-a g) (c+d x)}{(d f-c g) (a+b x)}\right )}{(b f-a g) h} \\
\end{align*}
Mathematica [B] (verified)
Leaf count is larger than twice the leaf count of optimal. \(303\) vs. \(2(123)=246\).
Time = 0.18 (sec) , antiderivative size = 303, normalized size of antiderivative = 2.46
\[
\int \frac {A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{a f h+b g h x^2+h (b f x+a g x)} \, dx=-\frac {-2 A \log (a+b x)+B n \log ^2(a+b x)-2 B n \log (a+b x) \log (c+d x)+2 B n \log \left (\frac {d (a+b x)}{-b c+a d}\right ) \log (c+d x)-2 B \log (a+b x) \log \left (e (a+b x)^n (c+d x)^{-n}\right )+2 A \log (f+g x)-2 B n \log (a+b x) \log (f+g x)+2 B n \log (c+d x) \log (f+g x)+2 B \log \left (e (a+b x)^n (c+d x)^{-n}\right ) \log (f+g x)+2 B n \log (a+b x) \log \left (\frac {b (f+g x)}{b f-a g}\right )-2 B n \log (c+d x) \log \left (\frac {d (f+g x)}{d f-c g}\right )+2 B n \operatorname {PolyLog}\left (2,\frac {g (a+b x)}{-b f+a g}\right )+2 B n \operatorname {PolyLog}\left (2,\frac {b (c+d x)}{b c-a d}\right )-2 B n \operatorname {PolyLog}\left (2,\frac {g (c+d x)}{-d f+c g}\right )}{(2 b f-2 a g) h}
\]
[In]
Integrate[(A + B*Log[(e*(a + b*x)^n)/(c + d*x)^n])/(a*f*h + b*g*h*x^2 + h*(b*f*x + a*g*x)),x]
[Out]
-((-2*A*Log[a + b*x] + B*n*Log[a + b*x]^2 - 2*B*n*Log[a + b*x]*Log[c + d*x] + 2*B*n*Log[(d*(a + b*x))/(-(b*c)
+ a*d)]*Log[c + d*x] - 2*B*Log[a + b*x]*Log[(e*(a + b*x)^n)/(c + d*x)^n] + 2*A*Log[f + g*x] - 2*B*n*Log[a + b*
x]*Log[f + g*x] + 2*B*n*Log[c + d*x]*Log[f + g*x] + 2*B*Log[(e*(a + b*x)^n)/(c + d*x)^n]*Log[f + g*x] + 2*B*n*
Log[a + b*x]*Log[(b*(f + g*x))/(b*f - a*g)] - 2*B*n*Log[c + d*x]*Log[(d*(f + g*x))/(d*f - c*g)] + 2*B*n*PolyLo
g[2, (g*(a + b*x))/(-(b*f) + a*g)] + 2*B*n*PolyLog[2, (b*(c + d*x))/(b*c - a*d)] - 2*B*n*PolyLog[2, (g*(c + d*
x))/(-(d*f) + c*g)])/((2*b*f - 2*a*g)*h))
Maple [C] (warning: unable to verify)
Result contains higher order function than in optimal. Order 9 vs. order 4.
Time = 25.90 (sec) , antiderivative size = 1447, normalized size of antiderivative =
11.76
| | |
method | result | size |
| | |
risch |
\(\text {Expression too large to display}\) |
\(1447\) |
| | |
|
|
|
[In]
int((A+B*ln(e*(b*x+a)^n/((d*x+c)^n)))/(a*f*h+b*g*h*x^2+h*(a*g*x+b*f*x)),x,method=_RETURNVERBOSE)
[Out]
1/2*I/h/(a*g-b*f)*ln(b*x+a)*B*Pi*csgn(I*(b*x+a)^n)*csgn(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b*x+a)^n/((d*x+c)^n))*csgn(I*e/((d*x+c)^n)*(b*x+a)^n)^2+1/2*I/h/(a*g-b*f)*ln(g*x+f)*B*Pi*csgn(I*e)*
csgn(I*e/((d*x+c)^n)*(b*x+a)^n)^2+1/2*I/h/(a*g-b*f)*ln(g*x+f)*B*Pi*csgn(I*(b*x+a)^n)*csgn(I*(b*x+a)^n/((d*x+c)
^n))^2+1/2*I/h/(a*g-b*f)*ln(g*x+f)*B*Pi*csgn(I/((d*x+c)^n))*csgn(I*(b*x+a)^n/((d*x+c)^n))^2-1/h*B*n/(a*g-b*f)*
ln(g*x+f)*ln((b*(g*x+f)+a*g-b*f)/(a*g-b*f))+1/h*B*n/(a*g-b*f)*ln(g*x+f)*ln((d*(g*x+f)+c*g-d*f)/(c*g-d*f))-1/h*
B*n/(a*g-b*f)*ln(b*x+a)*ln((-a*d+c*b+d*(b*x+a))/(-a*d+b*c))-1/h/(a*g-b*f)*ln(b*x+a)*B*ln(e)+1/h/(a*g-b*f)*ln(g
*x+f)*B*ln(e)-1/h*B*ln((b*x+a)^n)/(a*g-b*f)*ln(b*x+a)+1/h*B/(a*g-b*f)*ln(g*x+f)*ln((b*x+a)^n)-1/h*B*n/(a*g-b*f
)*dilog((b*(g*x+f)+a*g-b*f)/(a*g-b*f))+1/2/h*B*n/(a*g-b*f)*ln(b*x+a)^2+1/h*B*ln((d*x+c)^n)/(a*g-b*f)*ln(b*x+a)
-1/h*B/(a*g-b*f)*ln(g*x+f)*ln((d*x+c)^n)+1/h*B*n/(a*g-b*f)*dilog((d*(g*x+f)+c*g-d*f)/(c*g-d*f))-1/h*B*n/(a*g-b
*f)*dilog((-a*d+c*b+d*(b*x+a))/(-a*d+b*c))
Fricas [F]
\[
\int \frac {A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{a f h+b g h x^2+h (b f x+a g x)} \, dx=\int { \frac {B \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A}{b g h x^{2} + a f h + {\left (b f x + a g x\right )} h} \,d x }
\]
[In]
integrate((A+B*log(e*(b*x+a)^n/((d*x+c)^n)))/(a*f*h+b*g*h*x^2+h*(a*g*x+b*f*x)),x, algorithm="fricas")
[Out]
integral((B*log((b*x + a)^n*e/(d*x + c)^n) + A)/(b*g*h*x^2 + a*f*h + (b*f + a*g)*h*x), x)
Sympy [F(-1)]
Timed out. \[
\int \frac {A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{a f h+b g h x^2+h (b f x+a g x)} \, dx=\text {Timed out}
\]
[In]
integrate((A+B*ln(e*(b*x+a)**n/((d*x+c)**n)))/(a*f*h+b*g*h*x**2+h*(a*g*x+b*f*x)),x)
[Out]
Timed out
Maxima [F]
\[
\int \frac {A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{a f h+b g h x^2+h (b f x+a g x)} \, dx=\int { \frac {B \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A}{b g h x^{2} + a f h + {\left (b f x + a g x\right )} h} \,d x }
\]
[In]
integrate((A+B*log(e*(b*x+a)^n/((d*x+c)^n)))/(a*f*h+b*g*h*x^2+h*(a*g*x+b*f*x)),x, algorithm="maxima")
[Out]
A*(log(b*x + a)/((b*f - a*g)*h) - log(g*x + f)/((b*f - a*g)*h)) - B*integrate(-(log((b*x + a)^n) - log((d*x +
c)^n) + log(e))/(b*g*h*x^2 + a*f*h + (b*f*h + a*g*h)*x), x)
Giac [F]
\[
\int \frac {A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{a f h+b g h x^2+h (b f x+a g x)} \, dx=\int { \frac {B \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A}{b g h x^{2} + a f h + {\left (b f x + a g x\right )} h} \,d x }
\]
[In]
integrate((A+B*log(e*(b*x+a)^n/((d*x+c)^n)))/(a*f*h+b*g*h*x^2+h*(a*g*x+b*f*x)),x, algorithm="giac")
[Out]
integrate((B*log((b*x + a)^n*e/(d*x + c)^n) + A)/(b*g*h*x^2 + a*f*h + (b*f*x + a*g*x)*h), x)
Mupad [F(-1)]
Timed out. \[
\int \frac {A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{a f h+b g h x^2+h (b f x+a g x)} \, dx=\int \frac {A+B\,\ln \left (\frac {e\,{\left (a+b\,x\right )}^n}{{\left (c+d\,x\right )}^n}\right )}{h\,\left (a\,g\,x+b\,f\,x\right )+a\,f\,h+b\,g\,h\,x^2} \,d x
\]
[In]
int((A + B*log((e*(a + b*x)^n)/(c + d*x)^n))/(h*(a*g*x + b*f*x) + a*f*h + b*g*h*x^2),x)
[Out]
int((A + B*log((e*(a + b*x)^n)/(c + d*x)^n))/(h*(a*g*x + b*f*x) + a*f*h + b*g*h*x^2), x)